-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SYCL] [libdevice] Add vector overloads of ConvertBFloat16ToFINTEL and ConvertFToBFloat16INTEL #14085
Conversation
@intel/dpcpp-tools-reviewers friendly ping! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sycl-post-link changes are trivial and look good. Thanks.
}).wait(); | ||
|
||
if (err) | ||
std::cout << "failed\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there is a future change in the source that causes this test to fail someday, it'll be more work for whoever catches that ticket. Make the failure output more explicit. At minimum output "failed on host" and "failed on device". And if you know of anything else that might be useful to some unlucky co-worker, maybe include that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I'll improve the test output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, after looking at the test again, the test will currently output something like:
bfloat16[4] -> float[4] conversion on device... passed/failed
or
float[4] -> bfloat16[4] -> float[4] conversion on host.... passed/failed
for device and host respectively. There's a std::cout
before queue.submit()
which will output the type of conversion being performed along where the conversion takes place (host
/device
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lime Gin Tastes Metallic.
just one request for better test output
}).wait(); | ||
|
||
if (err) | ||
std::cout << "failed\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this go to std::cerr
instead of std::cout
?
…d ConvertFToBFloat16INTEL (intel#14085) This PR adds vector overloads of `ConvertBFloat16ToFINTEL` and `ConvertFToBFloat16INTEL` to libdevice (SPEC: https://spec.oneapi.io/level-zero/latest/core/SPIRV.html#bfloat16-conversions) and a wrapper around it (`BF16VecToFloatVec` and `FloatVecToBF16Vec`) in `ext::oneapi::detail`. These overloads are intended to optimize BFloat16 `marray`, `vec` operations, for which we currently do element-by-element `bfloat16 -> float -> bfloat16` conversions.
…cl::vec` of `bfloat16` type to that of other data types (#14105) Follow-up of and blocked by: #14085 After this change: On host, conversion between `vec<bfloat16>` and `vec<float>` will happen element-by-element. While on device, we'll use Spirv intrinsic `OpConvertFToBF16INTEL` and `OpConvertBF16ToFINTEL` (https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_bfloat16_conversion.asciidoc) for vector conversion.
This PR adds vector overloads of
ConvertBFloat16ToFINTEL
andConvertFToBFloat16INTEL
to libdevice (SPEC: https://spec.oneapi.io/level-zero/latest/core/SPIRV.html#bfloat16-conversions) and a wrapper around it (BF16VecToFloatVec
andFloatVecToBF16Vec
) inext::oneapi::detail
.These overloads are intended to optimize BFloat16
marray
,vec
operations, for which we currently do element-by-elementbfloat16 -> float -> bfloat16
conversions.